package com.geqian.web.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.geqian.web.entity.Table;
import com.geqian.web.pojo.ColumnDefinition;
import com.geqian.web.pojo.Index;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author geqian
 * @date 13:35 2023/11/18
 */
public interface TableMapper extends BaseMapper<Table> {

    List<Table> selectTableList(String schemaName);

    List<String> selectTables(String schemaName);

    List<Table> selectTableByTableName(@Param("schemaName") String schemaName, @Param("tableName") String tableName);

    List<ColumnDefinition> selectColumnDefinitions(@Param("schemaName") String schemaName, @Param("tableName") String tableName);

    void clearTable(String tableName);

    int deleteBatch(List<Table> tableList);

    List<Index> selectIndexList(@Param("schemaName") String schemaName, @Param("tableName") String tableName);
}